package com.ytjj.qmyx.admin.eunm.im;

/**
 * 会话状态枚举类
 */
public enum YxImSessionStatusEnum {
    CONNECT(1, "沟通中"),
    FINISH(2, "已完成"),
    OFFLINE(3, "已离线")
    ;

    private Integer code;
    private String message;

    YxImSessionStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Integer code){
        for (YxImSessionStatusEnum value : YxImSessionStatusEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }

    public static Integer getCodeByMessage(String message){
        for (YxImSessionStatusEnum value : YxImSessionStatusEnum.values()) {
            if(value.getMessage().equals(message)){
                return value.getCode();
            }
        }
        return null;
    }
}
